import Taro, { Component } from '@tarojs/taro'
import PropTypes from 'prop-types'
import { View, Form } from "@tarojs/components";
import { AtTabBar } from "taro-ui"

import './index.less';

export default class BottomTab extends Component{
  showTab(index) {
    if (index == this.props) {
        return
    }
    switch (index) {
        case 0:
            Taro.redirectTo({
                url: `/pages/index/index`
            })
            break;
        case 1:
            Taro.redirectTo({
                url: `/pages/UserCenter/index`
            })
            break;
        default:
            break;
      }
  }
  render () {
    const tabList = [
      { title: '问诊', iconPrefixClass:'icon', iconType: 'tabqa' },
      { title: '我的', iconPrefixClass:'icon', iconType: 'mine' },
  ]

  return (
      <View>
          <AtTabBar
          fixed
          tabList={tabList}
          onClick={this.showTab}
          current={this.props.tab}
          color={'#bdbcbe'}
          selectedColor={'#ae58ed'}/>
      </View>
  )
  }
}
